// 实时水流数据状态坤
import { defineStore } from 'pinia'
import { flowGet } from '../../api/realTime/realTimeData'
interface dataListType {
    region: string,
    pressure: string,
    attention: boolean,
    turnoverTime: string
}

interface stateStyle {
    dataList: Array<dataListType>
}

export const userRealTimeFlow = defineStore('alerts', {
    state: () => <stateStyle>({
        dataList: [],
        stated: null
    }),
    actions: {
        async dataInit(where: Array<number>) {
            let res = await flowGet(where)
            // console.log(res);
            this.dataList = res.data.results
        }
    }
})
